perm filename TMP.TEX[WEB,ALS]7 blob sn#742880 filedate 1984-02-22 generic text, type C, neo UTF8
COMMENT ⊗   VALID 00002 PAGES
C REC  PAGE   DESCRIPTION
C00001 00001
C00002 00002	\def\a{\b}
C00021 ENDMK
C⊗;
\def\a{\b}
\def\b{A\def\a{B\def\a{\b}}}

\a\a\a

\a
\a
\bye
%\def\puzzle{\a\a\a\a}
%\puzzle

\pagelayout{normal}
\documentstyle{article}
\begin{document}
\bibitem{knuth-82} Knuth, Donald E. ; The Texbook

This is just a simple sentence to see if LaTeX works. \cite{Knuth-tex82}
\end{document}

*\show\cite
> \cite=macro:
#1->\if@filesw \immediate \write \@auxout {\string \citation {#1}}\fi \def \@cit
ea {}\@cite {\@for \@citeb :=#1\do {\@citea \def \@citea {,}\@ifundefined {b@\@c
iteb }{{\bf ?}\@warning {Citation `\@citeb ' on page \co@page \space undefined}}
{\csname b@\@citeb \endcsname }}}.
<*> \show\cite
              
? ↑C
↑C

%\magnification=1200
\font\Z=manfnt
\def\META{{\Z METAFONT}} 
\def\La{L\kern-.1667em\raise.5ex\hbox{a}\kern-.1em}
\def\fl#1{\null\par \leftline{\bf #1?}}
\def\teX{\null\kern1.5pt\TeX}
\def\The{\null\kern1.5pt The}
\def\\{{\tt \char'134}}
\def\cs{{\sl control sequence}} 
\def\css{{\sl control sequences}} 
\def\Css{{\sl Control sequences}}
\def\lbr{{\tt \char'173}}  \def\rbr{{\tt \char'175}}  \def\rrbr{{\tt \char'175\char'175}}
\def\und{\tt \char'137}
\def\til{\tt \char'176}
\def\sup{\tt \char'136}
\parskip 10pt plus 1pt
\parindent=0pt
\def\AmSTeX{$\cal A\kern-.1667em\lower.5ex\hbox{$\cal M$}\kern-.125em S$-\TeX}
\pageno=1
\font\sixrm=amr6
\font\eightrm=amr8
\font\ninerm=amr9
\font\rmhalf=amr10 scaled \magstephalf
\font\rmone=amr10 scaled \magstep1
\font\rmtwo=amr10 scaled \magstep2
\font\rmthree=amr10 scaled \magstep3
\font\rmfour=amr10 scaled \magstep4
\font\rmfive=amr10 scaled \magstep5
\font\bfl=ambx10 scaled \magstep2
\font\amss=amss10  \font\amssi=amssi10  \font\amsltt=amsltt10
\font\amu=amu10  \font\ambi=ambi10
\font\Dunh=amdunh10  \font\amssbx=amssbx10  \font\amcsc=amcsc10
\def\trademark{{\kern-.13em\raise 1ex\hbox{\fiverm
\ooalign {\hfil\kern.03em \raise .09ex\hbox {R}\hfil \crcr 
\lower .25ex\hbox{\mathhexbox 20D}}}}}
%\rightskip \z@ plus2em \spaceskip .3333em \xspaceskip .5em .
\def\ragcent{\raggedright \leftskip=\rightskip}
\def\ragleft{\leftskip=0pt plus2em \spaceskip.3333em \xspaceskip.5em }

\def\raggedcenter{\leftskip=0pt plus4em \rightskip=\leftskip
  \parfillskip=0pt \spaceskip=.3333em \xspaceskip=.5em
  \pretolerance=9999 \tolerance=9999
  \hyphenpenalty=9999 \exhyphenpenalty=9999 }
\def\loterms{\hbox{\rm lower order terms}}

\centerline{\bf \TeX\ Macros Made Easy}

This is a follow-up manual to ``First Grade \TeX\ A Beginner' Manual'' and
it assumes that the reader is reasonably well acquainted with the
rudiments of \TeX, at least to the extent that they are covered in this
earlier manual.  In contrast with this earlier manual, where the aim was
to condense much of
the more immediately useful part the \TeX's r'e protare of commands into a 
thirty-four page text, the present manual is, if anything, an expansion of
the material in Chapter~20 of ``The \TeX book'', with a liberal sprinkling
of ideas culled from Appendix~B and Appendix~D, all
 in an attempt to remove
most of the mystery that seems to surround the writing of \TeX\ macros.

Writing \TeX\ macros is really not all that difficult.
While the writing of a complete set of macros, such as those contained 
in ``The \La\TeX\ Document preparation System'' by Leslie Lamport or in
``The Joy of \TeX'' by Michael Spivak, is not a task to be undertaken lightly,
do not dispair.
\TeX's macro facility is not all that difficult to understand, and the \TeX\
user who has mastered the rudiments of \TeX, as outlined in ``First Grade \TeX''
is well prepared to go on the task of either writing his own macros, to suppliment
those provided by {\tt PLAIN.TEX} or of hand tailoring a few macros, lifted
from any one of a number of sources, to better fit his or her own particular needs.


\TeX's macro facility is extremely powerful, so powerful, in fact, that it
is quite intiminating to the novice it appears to involve mysteries that are
quite beyond comprehension.

Much of this apparent mysticism seems to reside in the fact that the novice is
disposed to think that the facility must be quite complicated when in fact the
power of the macro facility resides in the fact that there are a very few and
extremely simple rules which \TeX\ applies in a very mechanical and rigorous
way.
So, before getting into the details, let us see if we cannot state these simple rules
in a way that will dispel this air of mystery and allow you the really understand what it is all about.


Actually, this power resides in a few
extremely simple rules that govern the way that \TeX\ interprets the
macros that it encounters and


We will, however repeat some of the elementary notions relating to macros in this 
section. But first, some general remarks about \TeX's macro

First Grade \TeX\ used as an example of a simple macro the definition:
\smallskip
\centerline{\tt \\def\\loterms\lbr \\hbox\lbr \\rm lower order terms\rrbr.}
\smallskip
Such macros all
begin with the control sequence
`{\tt \\def}' followed by the new name and then the meaning to be assigned to
this new name (enclosed in braces that are not a part of the definition).
If braces are wanted as a part of the definition they must be added.

Having made such a definition, to get:
$$x↑3+\loterms \hbox{\qquad you type \qquad {\tt \$x\↑{}3+\\loterms\$}}$$

The second basic idea refered to in First Grade \TeX\ was the fact that macros
may, and, in fact, very often do, use other macros in their definitions.

\bye

\def\a{\b}
\def\b{A\def\a{B\def\a{\b}}}
\a\ Now reverse it. \a\ Now what is it? \a\ And now what? \a\
\bye
\def\puzzle{\a\a\a\a\a\a}
\puzzle
\bye


\centerline{Introducing \TeX\kern .1em
\footnote{\trademark}{\TeX\ is a trademark
of the American Mathematical Society.}}
%\ragcent
%\ragleft
\teX\ is a computerized typesetting system that is regularly used for
technical papers,
business forms, letters, theses, concert programs,
catalogues, and books of all sorts and in particular those that are
technical and highly mathematical. \teX\ was created by Professor Donald
E. Knuth and his associates and students at Stanford University.  The
current version, with many new features, has been completely rewritten by
Professor Knuth, after several years of operating experience with the
earlier versions on many different~computer~systems.


\The\ \TeX\ system has been standardized
to produce identical results on different computer systems and it will run
on any reasonably large system.  The \TeX\ output files are also device
independent. The output may be printed on
a graphics printer of modest capabilities for proofing and, when the results
are satisfactory, the same output may
be used with a higher quality printer or phototypesetting system to
produce the final document.

\fl{How does \TeX\ differ from other document compilers}
\TeX\ provides for automatic ligature replacements, kerning, hyphenation,
line justification, centering, flushing right or left, tabular aligning,
the formatting of complicated mathematical expressions, automatic section and page
numbering, page breaking, the introduction of running heads, the numbering
and placing of footnotes, and the automatic preparation of a table of contents and an
index, to name but a few of its special features.
As many as 256 different fonts with up to 256 characters per font may be
used for a single document.
\TeX's real forte is mathematics:
$$
\sum_{i=1}↑{\infty}{1\over2↑i}=1,\quad
\{\underbrace{\overbrace{\mathstrut a,\ldots,a}
      ↑{k\;a\mathchar`'\rm s},
    \overbrace{\mathstrut b,\ldots,b}
      ↑{l\;b\mathchar`'\rm s}}_{k+l\rm\;elements}\},\quad
\sqrt{1+\sqrt{1+\sqrt{1+x}}},\quad
A=\pmatrix{
a_{11}&\ldots&a_{1n}\cr
\vdots&\ddots&\vdots\cr
a_{m1}&\ldots&a_{mn}\cr},
$$
$$
\biggl(\int_{-\infty}↑\infty e↑{-x↑2}\,dx\biggr)↑2=\pi,\quad
 2\uparrow\uparrow k\mathrel{\mathop=↑{\rm def}}
  2↑{2↑{2↑{\cdot↑{\cdot↑{\cdot↑2}}}}}
    \vbox{\hbox{$\Big\}\scriptstyle k$}\kern0pt},\quad
{f(x+\Delta x)-f(x)\over\Delta x}\to f'(x)\;\;\hbox{as $\;\Delta x\to0$}.
$$
\TeX\ differs from other document compilers in that it performs 
all of the above functions, while meeting the highest typographic standards, and
at the same time it provides
an extremely great amount of flexibility to allow formatting of a
wide range of document types and styles, subject only to the detailed
requirements of the user.
Flexibility is achieved by the use of a comprehensive set
of low-level typographic primitives and by mechanisms that allow these
primitives to be used for the creation of higher-level constructs,
called `{\sl macros\/}', that the user may write, or
that come supplied as `{\sl macro packages\/}'.

\bye

\ddangerexercise Devise a ↑|\raggedcenter| macro (analogous to ↑|\raggedright|)
that partitions the words of a paragraph into as few as possible lines
of approximately equal size and centers each individual line. Hyphenation
should be avoided if possible.
\answer |\def\raggedcenter{\leftskip=0pt plus4em \rightskip=\leftskip|%
\parbreak|\parfillskip=0pt \spaceskip=.3333em \xspaceskip=.5em|\parbreak
        |\pretolerance=9999 \tolerance=9999|\parbreak
        |\hyphenpenalty=9999 \exhyphenpenalty=9999 }|


\font\sll=amsl9

\centerline{\fiverm\TeX}

\centerline{\fiverm\TeX{\sixrm\TeX}\TeX}

\centerline{\fiverm\TeX{\sixrm\TeX{\sevenrm\TeX}\TeX}\TeX}

\centerline{\fiverm\TeX{\sixrm\TeX{\sevenrm\TeX{\eightrm\TeX
}\TeX}\TeX}\TeX}

\centerline{\fiverm\TeX{\sixrm\TeX{\sevenrm\TeX{\eightrm\TeX
{\ninerm \TeX}\TeX}\TeX}\TeX}\TeX}

\centerline{\fiverm\TeX{\sixrm\TeX{\sevenrm\TeX{\eightrm\TeX
{\ninerm \TeX{\rm\TeX}\TeX}\TeX}\TeX}\TeX}\TeX}

\centerline{\fiverm\TeX{\sixrm\TeX{\sevenrm\TeX{\eightrm\TeX
{\ninerm \TeX{\rm\TeX{\rmhalf\TeX
}\TeX}\TeX}\TeX}\TeX}\TeX}\TeX}

\centerline{\fiverm\TeX{\sixrm\TeX{\sevenrm\TeX{\eightrm\TeX
{\ninerm \TeX{\rm\TeX{\rmhalf\TeX{\rmone\TeX
}\TeX}\TeX}\TeX}\TeX}\TeX}\TeX}\TeX}

\centerline{\fiverm\TeX{\sixrm\TeX{\sevenrm\TeX{\eightrm\TeX
{\ninerm \TeX{\rm\TeX{\rmhalf\TeX{\rmone\TeX{\rmtwo\TeX
}\TeX}\TeX}\TeX}\TeX}\TeX}\TeX}\TeX}\TeX}

\centerline{\fiverm\TeX{\sixrm\TeX{\sevenrm\TeX{\eightrm\TeX
{\ninerm \TeX{\rm\TeX{\rmhalf\TeX{\rmone\TeX{\rmtwo\TeX{\rmthree\TeX
}\TeX}\TeX}\TeX}\TeX}\TeX}\TeX}\TeX}\TeX}\TeX}

\centerline{\fiverm\TeX{\sixrm\TeX{\sevenrm\TeX{\eightrm\TeX
{\ninerm \TeX{\rm\TeX{\rmhalf\TeX{\rmone\TeX{\rmtwo\TeX{\rmthree\TeX
{\rmfour\TeX}\TeX}\TeX}\TeX}\TeX}\TeX}\TeX}\TeX}\TeX}\TeX}\TeX}


\centerline{\fiverm\TeX{\sixrm\TeX{\sevenrm\TeX{\eightrm\TeX
{\ninerm \TeX{\rm\TeX{\rmhalf\TeX{\rmone\TeX{\rmtwo\TeX{\rmthree\TeX
{\rmfour\TeX{\rmfive\TeX}\TeX}\TeX}\TeX}\TeX}\TeX}\TeX}\TeX}\TeX}\TeX}\TeX}\TeX}

\centerline{\fiverm\TeX{\sixrm\TeX{\sevenrm\TeX{\eightrm\TeX
{\ninerm \TeX{\rm\TeX{\rmhalf\TeX{\rmone\TeX{\rmtwo\TeX{\rmthree\TeX
{\rmfour\TeX}\TeX}\TeX}\TeX}\TeX}\TeX}\TeX}\TeX}\TeX}\TeX}\TeX}

\centerline{\fiverm\TeX{\sixrm\TeX{\sevenrm\TeX{\eightrm\TeX
{\ninerm \TeX{\rm\TeX{\rmhalf\TeX{\rmone\TeX{\rmtwo\TeX{\rmthree\TeX
}\TeX}\TeX}\TeX}\TeX}\TeX}\TeX}\TeX}\TeX}\TeX}

\centerline{\fiverm\TeX{\sixrm\TeX{\sevenrm\TeX{\eightrm\TeX
{\ninerm \TeX{\rm\TeX{\rmhalf\TeX{\rmone\TeX{\rmtwo\TeX
}\TeX}\TeX}\TeX}\TeX}\TeX}\TeX}\TeX}\TeX}

\centerline{\fiverm\TeX{\sixrm\TeX{\sevenrm\TeX{\eightrm\TeX
{\ninerm \TeX{\rm\TeX{\rmhalf\TeX{\rmone\TeX
}\TeX}\TeX}\TeX}\TeX}\TeX}\TeX}\TeX}

\centerline{\fiverm\TeX{\sixrm\TeX{\sevenrm\TeX{\eightrm\TeX
{\ninerm \TeX{\rm\TeX{\rmhalf\TeX
}\TeX}\TeX}\TeX}\TeX}\TeX}\TeX}

\centerline{\fiverm\TeX{\sixrm\TeX{\sevenrm\TeX{\eightrm\TeX
{\ninerm \TeX{\rm\TeX
}\TeX}\TeX}\TeX}\TeX}\TeX}

\centerline{\fiverm\TeX{\sixrm\TeX{\sevenrm\TeX{\eightrm\TeX
{\ninerm \TeX
}\TeX}\TeX}\TeX}\TeX}

\centerline{\fiverm\TeX{\sixrm\TeX{\sevenrm\TeX{\eightrm\TeX
}\TeX}\TeX}\TeX}

\centerline{\fiverm\TeX{\sixrm\TeX{\sevenrm\TeX}\TeX}\TeX}

\centerline{\fiverm\TeX{\sixrm\TeX}\TeX}

\centerline{\fiverm\TeX}

\bye